| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Zeta Zhul
Caldari Preemptive Paranoia
|
Posted - 2011.03.21 04:09:00 -
[1]
A couple things.
1. The sample market history script on pastie.com does a walk through all directories, subdirectories, etc and deletes every single file.
Is there actually a reason why it deletes every single file regardless of the extension or type?
Because it seems to me that being that the output is in fact a CSV file that perhaps not deleting every last thing in the directory tree might be a worthwhile consideration.
2. If you are planning on using that sample script be advised that if you output the CSV file to your "C:/" root directory that you will in fact be committing computer suicide.
sigh.
3. No I didn't output to the root directory. But I did output to a directory with some subdirectories that had stuff in it that I would rather have kept. Oh well. Sometimes necessity leads to refactoring crappy code.
|

Zeta Zhul
Caldari Preemptive Paranoia
|
Posted - 2011.03.21 15:29:00 -
[2]
Originally by: Entity
Originally by: Zeta Zhul A couple things.
1. The sample market history script on pastie.com does a walk through all directories, subdirectories, etc and deletes every single file.
Is there actually a reason why it deletes every single file regardless of the extension or type?
Because it seems to me that being that the output is in fact a CSV file that perhaps not deleting every last thing in the directory tree might be a worthwhile consideration.
2. If you are planning on using that sample script be advised that if you output the CSV file to your "C:/" root directory that you will in fact be committing computer suicide.
sigh.
3. No I didn't output to the root directory. But I did output to a directory with some subdirectories that had stuff in it that I would rather have kept. Oh well. Sometimes necessity leads to refactoring crappy code.
Wrong thread?
No actually it's the right thread.
It's this script. I'm sure you're aware of it and probably familiar with it. I just wanted to warn people that the script, as is, will conduct a complete directory walk and delete every single file regardless of type. So if you're going to run this script you must ensure that the output directory doesn't have anything important *and* neither do any subdirectories.
Offending code block:
Quote:
print "Deleting old records... \n" for root, dirs, files in os.walk(OUTPATH, topdown=False): for name in files: os.remove(os.path.join(root, name))
I will fully admit that I should have review the whole thing, line by line, before running it. But as the script merely outputs a CSV file it simply did not occur to me that "Deleting old records..." would actually involve deleting everything including old records and pretty much anything else lying around.
|

Zeta Zhul
Caldari Preemptive Paranoia
|
Posted - 2011.05.07 20:33:00 -
[3]
Originally by: Moto Akimoto Just FYI, I finally have Reverence running on my Mac OSx. Yay! I'm not a programmer so it took me a while to figure out.
Thanks Entity, this is good stuff!
Hey that's great!
BTW I have an updated python script that includes the typeid in the market history extract. What I do is run through a whole list of market items, then run the extract script and then import it all into a MySQL database. It is a lot simpler to have the typeid on every row rather than having to parse out the name of the file.
Let me know if you want it.
|
| |
|